home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programmer Power Tools
/
Programmer Power Tools.iso
/
turbopas
/
tp_tsr.arc
/
CPATH.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-02-11
|
1KB
|
25 lines
{═══════════════════════════════ CPATH.PAS ═══════════════════════════════}
{ ───────── Turbo 4.0/5.0 stay-resident demonstration program ───────── }
{ Copyright (c) 1989 Richard W. Prescott }
{ This simple resident program displays the current directory at the }
{ command prompt (e.g. C:\TURBO> ) if the default drive is C or higher. }
{ Avoids directory check delay on floppy drives. Assumes default PROMPT. }
{═══════════════════════════════ CPATH.PAS ═══════════════════════════════}
{$M $400,0,0}
Uses Dos,Dos21_0A;
{$F+} PROCEDURE ServiceProc; {$F-} {- Force FAR Return -}
{- The Pascal code for the Interrupt Service must be a FAR Procedure -}
Var Directory: STRING[67];
BEGIN
IF (DefaultDrive >= 'C') AND (User^.Ds = CommandSig) THEN BEGIN
GetDir(0,Directory);
WRITE(#8,#8,Directory,'>'); {then chain to normal 0A service}
END; {IF DefaultDrive >= 'C' THEN }
END; {- Normal Proc Exit provides RETF to caller DOS21_0A.IHook -}
BEGIN
Dos21_0A.PascalCode := @ServiceProc; {- Initialize Pascal Code Pointer -}
Keep(0); {- Terminate and Stay Resident -}
END.